﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Lambda表达式.aspx.cs" Inherits="_35newpart_Linq_Lambda表达式" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">


p
{
	font-size: 10pt;
	margin: 10px 0px;
}

    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <p class="MsoNormal" style="LINE-HEIGHT: 150%">
            <strong style="mso-bidi-font-weight: normal"><span lang="EN-US">Lambda</span><span 
                style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表达式</span><span 
                lang="EN-US"><O:P></O:P></span></strong></p>
        <p class="MsoNormal" style="LINE-HEIGHT: 150%">
            <span lang="EN-US"><O:P>&nbsp;</O:P></span></p>
        <p>
            <table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" 
                style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext">
                <tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
                    <td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 426.1pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt" 
                        valign="top" width="568">
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            var</span><span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes"> 
                            list = <span style="COLOR: blue">new</span> [] { <span style="COLOR: #a31515">
                            &quot;aa&quot;</span>, <span style="COLOR: #a31515">&quot;bb&quot;</span>,
                            <span style="COLOR: #a31515">&quot;ac&quot;</span> };<O:P></O:P></span></p>
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            var</span><span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes"> 
                            result = <span style="COLOR: #2b91af">Array</span>.FindAll(list, s =&gt; 
                            (s.IndexOf(<span style="COLOR: #a31515">&quot;a&quot;</span>) &gt; -1));<O:P></O:P></span></p>
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            foreach</span><span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes"> 
                            (<span style="COLOR: blue">var</span> v <span style="COLOR: blue">in</span> 
                            result)<O:P></O:P></span></p>
                        <p class="MsoNormal" style="TEXT-INDENT: 18pt; LINE-HEIGHT: 150%">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; COLOR: #2b91af; LINE-HEIGHT: 150%; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            Console</span><span lang="EN-US" 
                                style="FONT-SIZE: 9pt; LINE-HEIGHT: 150%; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">.WriteLine(v);<O:P></O:P></span></p>
                        <p class="MsoNormal" style="TEXT-INDENT: 18pt; LINE-HEIGHT: 150%">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; LINE-HEIGHT: 150%; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes"><V:SHAPE 
id=_x0000_i1030 style="WIDTH: 12pt; HEIGHT: 18.75pt" 
type="#_x0000_t75"><V:IMAGEDATA 
src="file:///C:\DOCUME~1\yzhu\LOCALS~1\Temp\msohtml1\01\clip_image011.png" 
o:title=""></V:IMAGEDATA></V:SHAPE><O:P></O:P></span>
                        </p>
                    </td>
                </tr>
            </table>
        </p>
        <p class="MsoNormal" style="LINE-HEIGHT: 150%">
            <span lang="EN-US"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </span></span>
            <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
            其实和</span><span lang="EN-US">2.0</span><span 
                style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中的匿名方法差不多，都是用于产生内联方法，只不过</span><span 
                lang="EN-US">Lambda</span><span 
                style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表达式的语法更为简洁。语法如下：</span></p>
        <p class="MsoNormal" style="LINE-HEIGHT: 150%">
            <span lang="EN-US"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </span>(</span><span 
                style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">参数列表</span><span 
                lang="EN-US">) =&gt; </span>
            <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
            表达式或者语句块</span></p>
        <p class="MsoNormal" style="LINE-HEIGHT: 150%">
            <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
            其中：</span></p>
        <p class="MsoNormal" style="LINE-HEIGHT: 150%">
            <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
            参数个数：可以有多个参数，一个参数，或者无参数。</span></p>
        <p class="MsoNormal" style="LINE-HEIGHT: 150%">
            <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
            表达式或者语句块：这部分就是我们平常写函数的实现部分（函数体）。</span></p>
        <p class="MsoNormal" style="LINE-HEIGHT: 150%">
            <span lang="EN-US"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </span></span>
            <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
            前面的示例分别是</span><span lang="EN-US">1</span><span 
                style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个参数的例子，下面结合扩展方法来一个复杂的例子：</span></p>
        <p>
            <table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" 
                style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext">
                <tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
                    <td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 426.1pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt" 
                        valign="top" width="568">
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>
                            <span style="COLOR: blue">public</span> <span style="COLOR: blue">delegate</span>
                            <span style="COLOR: blue">int</span> <span style="COLOR: #2b91af">mydg</span>(<span 
                                style="COLOR: blue">int</span> a, <span style="COLOR: blue">int</span> b);<O:P></O:P></span></p>
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </span><O:P></O:P>
                            </span>
                        </p>
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>
                            <span style="COLOR: blue">public</span> <span style="COLOR: blue">static</span>
                            <span style="COLOR: blue">class</span> <span style="COLOR: #2b91af">LambdaTest<O:P></O:P></span></span></p>
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<O:P></O:P></span></p>
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            </span><O:P></O:P></span>
                        </p>
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            </span><span style="COLOR: blue">public</span> <span style="COLOR: blue">static</span>
                            <span style="COLOR: blue">int</span> oper(<span style="COLOR: blue">this</span>
                            <span style="COLOR: blue">int</span> a, <span style="COLOR: blue">int</span> b,
                            <span style="COLOR: #2b91af">mydg</span> dg)<O:P></O:P></span></p>
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            </span>{<O:P></O:P></span></p>
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            </span><span style="COLOR: blue">return</span> dg(a, b);<O:P></O:P></span></p>
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            </span>}<O:P></O:P></span></p>
                        <p class="MsoNormal" style="LINE-HEIGHT: 150%">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; LINE-HEIGHT: 150%; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<O:P></O:P></span></p>
                        <p class="MsoNormal" style="LINE-HEIGHT: 150%">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; LINE-HEIGHT: 150%; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes"><O:P>
                            &nbsp;</O:P></span></p>
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; COLOR: #2b91af; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            Console</span><span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">.WriteLine(1.oper(2, 
                            (a, b) =&gt; a + b));<O:P></O:P></span></p>
                        <p class="MsoNormal" style="LINE-HEIGHT: 150%">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; COLOR: #2b91af; LINE-HEIGHT: 150%; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            Console</span><span lang="EN-US" 
                                style="FONT-SIZE: 9pt; LINE-HEIGHT: 150%; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">.WriteLine(2.oper(1, 
                            (a, b) =&gt; a - b));<O:P></O:P></span></p>
                        <p class="MsoNormal" style="LINE-HEIGHT: 150%">
                            <span lang="EN-US"><V:SHAPE 
id=_x0000_i1031 style="WIDTH: 7.5pt; HEIGHT: 22.5pt" 
type="#_x0000_t75"><V:IMAGEDATA 
src="file:///C:\DOCUME~1\yzhu\LOCALS~1\Temp\msohtml1\01\clip_image013.png" 
o:title=""></V:IMAGEDATA></V:SHAPE></span>
                        </p>
                    </td>
                </tr>
            </table>
        </p>
        <p class="MsoNormal" style="LINE-HEIGHT: 150%">
            <strong style="mso-bidi-font-weight: normal"><span lang="EN-US"><O:P>&nbsp;</O:P></span></strong></p>
        <p class="MsoNormal" style="LINE-HEIGHT: 150%">
            <strong style="mso-bidi-font-weight: normal">
            <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
            查询句法</span><span lang="EN-US"><O:P></O:P></span></strong></p>
        <p class="MsoNormal" style="LINE-HEIGHT: 150%">
            <span lang="EN-US"><O:P>&nbsp;</O:P></span></p>
        <p>
            <table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" 
                style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext">
                <tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
                    <td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 426.1pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt" 
                        valign="top" width="568">
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            var</span><span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes"> 
                            persons = <span style="COLOR: blue">new</span> <span style="COLOR: #2b91af">List</span>&lt;<span 
                                style="COLOR: #2b91af">Person</span>&gt; {<O:P></O:P></span></p>
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>
                            <span style="COLOR: blue">new</span> <span style="COLOR: #2b91af">Person</span> 
                            {username = <span style="COLOR: #a31515">&quot;a&quot;</span>, age=19}, <O:P></O:P></span>
                        </p>
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>
                            <span style="COLOR: blue">new</span> <span style="COLOR: #2b91af">Person</span> 
                            {username = <span style="COLOR: #a31515">&quot;b&quot;</span>, age=20},<O:P></O:P></span></p>
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>
                            <span style="COLOR: blue">new</span> <span style="COLOR: #2b91af">Person</span> 
                            {username = <span style="COLOR: #a31515">&quot;a&quot;</span>, age=21}, <O:P></O:P></span>
                        </p>
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>};<O:P></O:P></span></p>
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            var</span><span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes"> 
                            selectperson = <span style="COLOR: blue">from</span> p <span style="COLOR: blue">
                            in</span> persons <span style="COLOR: blue">where</span> p.age &gt;= 20
                            <span style="COLOR: blue">select</span> p.username.ToUpper();<O:P></O:P></span></p>
                        <p align="left" class="MsoNormal" 
                            style="TEXT-ALIGN: left; mso-layout-grid-align: none">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            foreach</span><span lang="EN-US" 
                                style="FONT-SIZE: 9pt; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">(<span 
                                style="COLOR: blue">var</span> p <span style="COLOR: blue">in</span> 
                            selectperson)<O:P></O:P></span></p>
                        <p class="MsoNormal" style="TEXT-INDENT: 18pt; LINE-HEIGHT: 150%">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; LINE-HEIGHT: 150%; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes">
                            <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>
                            <span style="COLOR: #2b91af">Console</span>.WriteLine(p);<O:P></O:P></span></p>
                        <p class="MsoNormal" style="TEXT-INDENT: 18pt; LINE-HEIGHT: 150%">
                            <span lang="EN-US" 
                                style="FONT-SIZE: 9pt; LINE-HEIGHT: 150%; FONT-FAMILY: Consolas; mso-font-kerning: 0pt; mso-no-proof: yes"><V:SHAPE 
id=_x0000_i1032 style="WIDTH: 6.75pt; HEIGHT: 21.75pt" 
type="#_x0000_t75"><V:IMAGEDATA 
src="file:///C:\DOCUME~1\yzhu\LOCALS~1\Temp\msohtml1\01\clip_image015.png" 
o:title=""></V:IMAGEDATA></V:SHAPE><O:P></O:P></span>
                        </p>
                    </td>
                </tr>
            </table>
        </p>
        <p class="MsoNormal" style="TEXT-INDENT: 18pt; LINE-HEIGHT: 150%">
            <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
            查询句法是使用标准的</span><span lang="EN-US">LINQ</span><span 
                style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">查询运算符来表达查询时一个方便的声明式简化写法。该句法能在代码里表达查询时增进可读性和简洁性，读起来容易，也容易让人写对。</span><span 
                lang="EN-US">Visual Studio </span>
            <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
            对查询句法提供了完整的智能感应和编译时检查支持。编译器在底层把查询句法的表达式翻译成明确的方法调用代码，代码通过新的扩展方法和</span><span 
                lang="EN-US">Lambda</span><span 
                style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表达式语言特性来实现。上面的查询句法等价于下面的代码：</span></p>
    </div>
    </form>
</body>
</html>
